From e63574cd5f5a6862285212b5434878dceb11ec91 Mon Sep 17 00:00:00 2001 From: Hollis Blanchard Date: Thu, 1 Mar 2007 13:18:51 -0600 Subject: [PATCH] [XEN] Add arch hook for max_mem domctl. This patch introduces an arch hook in the MAX_MEM hcall. In particular, PowerPC will use this hook to create/update a p2m mapping array. This patch introduces the hook only and should compile away on all arches. Signed-off-by: Ryan Harper Signed-off-by: Hollis Blanchard --HG-- extra : transplant_source : %BD%0B%97%A5i%FE%9F%5C%99%C2%01S%80%B6%C0%F0%82_l%A3 --- xen/common/domctl.c | 4 ++++ xen/include/asm-ia64/shadow.h | 2 ++ xen/include/asm-powerpc/shadow.h | 7 ++++++- xen/include/asm-x86/shadow.h | 2 ++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/xen/common/domctl.c b/xen/common/domctl.c index fd85b8cbd8..3a45586d65 100644 --- a/xen/common/domctl.c +++ b/xen/common/domctl.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -608,6 +609,9 @@ long do_domctl(XEN_GUEST_HANDLE(xen_domctl_t) u_domctl) spin_lock(&d->page_alloc_lock); if ( new_max >= d->tot_pages ) { + ret = guest_physmap_max_mem_pages(d, new_max); + if ( ret != 0 ) + break; d->max_pages = new_max; ret = 0; } diff --git a/xen/include/asm-ia64/shadow.h b/xen/include/asm-ia64/shadow.h index b877f76ea2..12d16c0e4b 100644 --- a/xen/include/asm-ia64/shadow.h +++ b/xen/include/asm-ia64/shadow.h @@ -61,6 +61,8 @@ shadow_mark_page_dirty(struct domain *d, unsigned long gpfn) return 0; } +#define guest_physmap_max_mem_pages(d, n) (0) + #endif // _XEN_SHADOW_H /* diff --git a/xen/include/asm-powerpc/shadow.h b/xen/include/asm-powerpc/shadow.h index e58191a7e9..f9703270ab 100644 --- a/xen/include/asm-powerpc/shadow.h +++ b/xen/include/asm-powerpc/shadow.h @@ -13,9 +13,10 @@ * along with this program; if not, write to the Free Software * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Copyright (C) IBM Corp. 2005, 2006 + * Copyright IBM Corp. 2005, 2006, 2007 * * Authors: Hollis Blanchard + * Ryan Harper */ #ifndef _ASM_SHADOW_H_ @@ -58,4 +59,8 @@ static inline unsigned int shadow_get_allocation(struct domain *d) { return (1ULL << (d->arch.htab.order + PAGE_SHIFT)) >> 20; } + +#define guest_physmap_max_mem_pages(d, n) (0) + #endif + diff --git a/xen/include/asm-x86/shadow.h b/xen/include/asm-x86/shadow.h index cfd8e841c8..e08b971e7a 100644 --- a/xen/include/asm-x86/shadow.h +++ b/xen/include/asm-x86/shadow.h @@ -121,6 +121,8 @@ static inline void shadow_remove_all_shadows(struct vcpu *v, mfn_t gmfn) sh_remove_shadows(v, gmfn, 0 /* Be thorough */, 1 /* Must succeed */); } +#define guest_physmap_max_mem_pages(d, n) (0) + #endif /* _XEN_SHADOW_H */ /* -- 2.30.2